<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奖励中心</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#2196F3',
                        'primary-light': '#64B5F6',
                        'primary-dark': '#1976D2'
                    }
                }
            }
        }
    </script>
    <style>
        body {
            background: #F5F7FA;
        }
        .safe-bottom {
            padding-bottom: calc(env(safe-area-inset-bottom) + 80px);
        }
        .btn-gradient {
            background: linear-gradient(to right, #2196F3, #1E88E5);
        }
        .points-card {
            background: linear-gradient(135deg, #2196F3, #1E88E5);
        }
    </style>
</head>
<body>
    <div class="w-[375px] mx-auto min-h-screen bg-white relative">
        <!-- 顶部导航 -->
        <header class="fixed top-0 w-[375px] z-50 bg-white border-b border-gray-100">
            <div class="h-[48px] px-4 flex items-center justify-center">
                <h1 class="text-lg font-medium text-gray-800">奖励中心</h1>
            </div>
        </header>

        <!-- 主内容区 -->
        <main class="pt-[48px] px-4 safe-bottom">
            <!-- 积分卡片 -->
            <div class="points-card mt-4 rounded-xl p-4 text-white">
                <div class="flex justify-between items-start">
                    <span class="text-sm opacity-90">我的积分</span>
                    <button class="text-sm opacity-90" onclick="showRules()">
                        <i class="fas fa-info-circle mr-1"></i>
                        积分规则
                    </button>
                </div>
                <div class="text-center my-4">
                    <span class="text-4xl font-medium">2,580</span>
                </div>
                <div class="flex justify-between text-sm opacity-90">
                    <span>今日已获得: 60积分</span>
                    <span>今日还可获得: 40积分</span>
                </div>
            </div>

            <!-- 已生成的图片 -->
            <div class="mt-6">
                <h2 class="text-lg font-medium text-gray-800 mb-4">我的奖励</h2>
                <div class="grid grid-cols-2 gap-4">
                    <div class="aspect-square rounded-xl overflow-hidden shadow-sm">
                        <img src="reward1.jpg" class="w-full h-full object-cover" alt="奖励图片">
                        <div class="text-xs text-gray-500 mt-1">2024-01-15</div>
                    </div>
                    <div class="aspect-square rounded-xl overflow-hidden shadow-sm">
                        <img src="reward2.jpg" class="w-full h-full object-cover" alt="奖励图片">
                        <div class="text-xs text-gray-500 mt-1">2024-01-14</div>
                    </div>
                    <div class="aspect-square rounded-xl overflow-hidden shadow-sm">
                        <img src="reward3.jpg" class="w-full h-full object-cover" alt="奖励图片">
                        <div class="text-xs text-gray-500 mt-1">2024-01-13</div>
                    </div>
                    <div class="aspect-square rounded-xl overflow-hidden shadow-sm">
                        <img src="reward4.jpg" class="w-full h-full object-cover" alt="奖励图片">
                        <div class="text-xs text-gray-500 mt-1">2024-01-12</div>
                    </div>
                </div>
            </div>
        </main>

        <!-- 底部导航栏 -->
        <nav class="fixed bottom-0 w-[375px] bg-white border-t border-gray-100">
            <div class="grid grid-cols-5 h-[56px]">
                <a href="generate.html" class="flex flex-col items-center justify-center">
                    <i class="fas fa-plus-circle text-gray-400"></i>
                    <span class="text-xs mt-1 text-gray-400">生成</span>
                </a>
                <a href="study.html" class="flex flex-col items-center justify-center">
                    <i class="fas fa-book text-gray-400"></i>
                    <span class="text-xs mt-1 text-gray-400">学习</span>
                </a>
                <a href="history.html" class="flex flex-col items-center justify-center">
                    <i class="fas fa-history text-gray-400"></i>
                    <span class="text-xs mt-1 text-gray-400">历史</span>
                </a>
                <a href="rewards.html" class="flex flex-col items-center justify-center">
                    <i class="fas fa-gift text-primary"></i>
                    <span class="text-xs mt-1 text-primary">奖励</span>
                </a>
                <a href="profile.html" class="flex flex-col items-center justify-center">
                    <i class="fas fa-user text-gray-400"></i>
                    <span class="text-xs mt-1 text-gray-400">我的</span>
                </a>
            </div>
            <div class="h-[env(safe-area-inset-bottom)]"></div>
        </nav>

        <!-- 生成按钮 -->
        <div class="fixed bottom-[56px] left-0 w-[375px] bg-white border-t border-gray-100 p-4">
            <button class="w-full h-[48px] btn-gradient text-white rounded-xl flex items-center justify-center">
                <i class="fas fa-magic mr-2"></i>
                生成奖励图片 (50积分/次)
            </button>
        </div>

        <!-- 规则说明弹窗 -->
        <div id="rules" class="fixed inset-0 bg-black/50 hidden items-center justify-center z-50">
            <div class="w-[320px] bg-white rounded-xl p-4">
                <div class="flex items-center mb-3">
                    <i class="fas fa-star text-primary w-[24px] h-[24px] flex items-center justify-center"></i>
                    <span class="ml-2 text-sm">每次生成题目 +10 积分</span>
                </div>
                <div class="flex items-center mb-3">
                    <i class="fas fa-gift text-primary w-[24px] h-[24px] flex items-center justify-center"></i>
                    <span class="ml-2 text-sm">每日首次额外 +20 积分</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-clock text-primary w-[24px] h-[24px] flex items-center justify-center"></i>
                    <span class="ml-2 text-sm">每日上限 100 积分</span>
                </div>
                <button onclick="hideRules()" class="w-full h-[44px] btn-gradient text-white rounded-xl mt-4">
                    知道了
                </button>
            </div>
        </div>
    </div>

    <script>
        function showRules() {
            const rules = document.getElementById('rules');
            rules.style.display = 'flex';
        }

        function hideRules() {
            const rules = document.getElementById('rules');
            rules.style.display = 'none';
        }
    </script>
</body>
</html>